<template>
  <div>
    <user-manager-table ref="umt" :type="4" :menuId="this.$route.query.id" v-on:listenToChildNewButtonEvent="newButtonEventFromChild" v-on:listenToChildEditButtonEvent="editButtonEventFromChild"></user-manager-table>
    <user-manager-dialog ref="umd" v-on:listenToChildRefreshEvent="refreshEventFromChild"></user-manager-dialog>
  </div>
</template>

<script>
  import userManagerTable from '@/view/userManager/userManagerTable.vue'
  import userManagerDialog from '@/view/userManager/userManagerDialog.vue'

  export default {
    components: {
      'user-manager-table': userManagerTable,
      'user-manager-dialog': userManagerDialog
    },
    data () {
      return {
      }
    },
    methods: {
      // 编辑用户（fromChild）
      editButtonEventFromChild (data) {
        this.$refs.umd.modifyUserDialog(data)
      },
      // 新建用户（fromChild）
      newButtonEventFromChild () {
        this.$refs.umd.createUserDialog()
      },
      // 刷新table
      refreshEventFromChild () {
        this.$refs.umt.getAllDatas()
      }
    }
  }
</script>
